// Seir programming Editor
// Copyright (c) <2007> <David Torres>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/*
 * Created by SharpDevelop.
 * User: David William Torres
 * Date: 5/29/2007
 * Time: 2:39 PM
 * 
 */

using System;
using Gtk;

namespace Seir
{
	/// <summary>
	/// Summary description for sAbout.
	/// </summary>
	public class sAbout : Gtk.Dialog
    {
        #region Variables

        private Gtk.Label s_AppNameLabel = null;
		private Gtk.Label s_AuthorsLabel = null;
		private Gtk.Label s_CopyRightLabel = null;
		private Gtk.VBox s_DialogContent = null;

        #endregion

        #region Constructors

        public sAbout()
        {
            this.Title = "Seir Text Editor";
            this.initComponents();
            this.ShowAll();
        }

        public sAbout(Gtk.Window winParent)
            : base("Seir Text Editor", winParent, Gtk.DialogFlags.DestroyWithParent)
        {
            this.initComponents();
            this.ShowAll();
        }

        #endregion

        #region Author array

        public string []Authors
		{
			set 
			{ 
				System.Text.StringBuilder strbAuthors = new System.Text.StringBuilder();
				string []straAuthors = value; 
				foreach(string strAuthor in straAuthors)
				{
					strbAuthors.AppendFormat("{0}\n", strAuthor);
				}
				s_AuthorsLabel.Text = strbAuthors.ToString();
			}
		}

        #endregion

        #region Initialize

        private void initComponents()
		{
			this.Modal = true;
			this.DefaultResponse = Gtk.ResponseType.Ok;
			this.AddButton("gtk-ok", Gtk.ResponseType.Ok);
			this.HeightRequest = 200;
			this.WidthRequest = 210;

			// Application Name
			this.s_AppNameLabel = new Label("Seir Text Editor");
			
			// Authors
			this.s_AuthorsLabel = new Label();

			// Copy Rght
			this.s_CopyRightLabel = new Label("(c) 2007 SELU\n");

			// Main dialog content container
			s_DialogContent = new VBox(true, 2);
			s_DialogContent.PackStart(s_AppNameLabel, true, true, 1);
			s_DialogContent.PackStart(s_AuthorsLabel, true, true, 1);
			s_DialogContent.PackStart(s_CopyRightLabel, true, true, 1);

			this.VBox.PackStart(this.s_DialogContent, true, true, 0);
        }

        #endregion

	}
}
